from django.conf.urls.defaults import *
from django.conf import settings

urlpatterns = patterns('crm',
    (r'^$', 'views.loginpage'),
    (r'^checklogin/$', 'views.checklogin'),
    (r'^test/$', 'views.test'),
    (r'^logout/$', 'views.logout'),
    (r'^index/$', 'views.admin_index'),
    (r'^admin_menu/$', 'views.admin_menu'),
    (r'^admin_top/$', 'views.admin_top'),
    (r'^admin_drag/$', 'views.admin_drag'),
    (r'^admin_main/$', 'views.admin_main'),
    (r'^adduser/$', 'users.adduser'),
    (r'^saveuser/$', 'users.saveuserinfo'),
    (r'^grouplist/$', 'salesgroup.grouplist'),  # huangzy edit
    (r'^edit_g/(?P<g_id>\w+)/$', 'salesgroup.edit_g'),  # huangzy edit 
    (r'^add_g/$', 'salesgroup.addgroup'),  # huangzy edit 
    (r'^del_g/(?P<g_id>\w+)/$','salesgroup.del_g'),  # huangzy edit 
    (r'^savegroups/$', 'salesgroup.savegroups'),  # huangzy edit
    (r'^rolelist/$', 'role.rolelist'),  # huangzy edit
    (r'^add_role/$', 'role.addrole'),  # huangzy edit
    (r'^saveroles/$', 'role.saveroles'),  # huangzy edit
    (r'^edit_role/(?P<g_id>\w+)/$', 'role.editrole'),  # huangzy edit
    (r'^del_role/(?P<g_id>\w+)/$', 'role.delrole'),  # huangzy edit
    (r'^ulist/$', 'users.ulist'),
    (r'^ulist/(?P<page>\w+)/$', 'users.ulist'),
    (r'^u/add_to_student/(?P<m_id>\w+)/$', 'users.add_to_student'),
    (r'^u/search/$', 'users.search'),
    (r'^u/search/(?P<page>\w+)/(?P<skind>\w+)/(?P<keyword>\w+)/$', 'users.search'),
    (r'^u/mail/$', 'users.getmail'),
    (r'^u/mail2/$', 'users.getmail2'),
    (r'^u/post/$', 'users.getpost'),
    (r'^u/post2/$', 'users.getpost2'),
    (r'^ulist/(?P<kind>\w+)/(?P<search_id>\w+)/$', 'users.ulist'),
    (r'^uinfo/(?P<m_id>\w+)/$','users.uinfo'),
    (r'^edit_u/(?P<m_id>\w+)/$','users.edit_u'),
    (r'^del_u/(?P<m_id>\w+)/$','users.del_u'),
    (r'^slist/$', 'sales.slist'),
    (r'^addsales/$', 'sales.addsales'),
    (r'^savesales/$', 'sales.savesales'),
    (r'^edit_s/(?P<s_id>\w+)/$','sales.edit_s'),
    (r'^modifypwd/(?P<s_id>\w+)/$','sales.modifypwd'),
    (r'^savenewpwd/$', 'sales.savenewpwd'),
    (r'^del_s/(?P<s_id>\w+)/$','sales.del_s'),
    (r'^del_s_ask/(?P<s_id>\w+)/$','sales.del_s'),
    (r'^del_s2/(?P<s_id>\w+)/$','sales.del_s2'),
    (r'^modifyname/$', 'sales.modifyname'),
    (r'^savename/$', 'sales.savename'),
    (r'^savepassword/$', 'sales.savepassword'),
    (r'^follow_up/(?P<m_id>\w+)/$','follow_up.finfo'),
    (r'^add_f/(?P<m_id>\w+)/$','follow_up.add'),
    (r'^add_fs/$','follow_up.saveadd'),
    (r'^edit_f/(?P<f_id>\w+)/$','follow_up.edit'),
    (r'^del_f/(?P<f_id>\w+)/$','follow_up.del_f'),
    (r'^next_follow_list/$', 'follow_up.next_follow_list'),
    (r'^del/next_follow_list/(?P<nf_id>\w+)/$', 'follow_up.del_next_follow_list'),
    (r'^alist/$', 'agents.alist'),
    (r'^alist/(?P<page>\w+)/$', 'agents.alist'),
    (r'^save_agent/$', 'agents.save'),
    (r'^edit_a/(?P<a_id>\w+)/$','agents.edit'),
    (r'^del_a/(?P<a_id>\w+)/$','agents.del_a'),

    (r'^filist/$', 'further.list'),
    (r'^save_fi/$', 'further.save'),
    (r'^edit_fi/(?P<fi_id>\w+)/$','further.edit'),
    (r'^del_fi/(?P<fi_id>\w+)/$','further.del_fi'),

    (r'^pjlist/$', 'projects.list'),
    (r'^pjlist/(?P<page>\w+)/$', 'projects.list'),
    (r'^save_pj/$', 'projects.save'),
    (r'^edit_pj/(?P<pj_id>\w+)/$','projects.edit'),
    (r'^del_pj/(?P<pj_id>\w+)/$','projects.del_pj'),

    (r'^p_information/$', 'projects.p_information'),
    (r'^p_information/course/del/(?P<pcid>\w+)/$', 'projects.p_info_course_del'),
    (r'^p_information/course/edit/(?P<pcid>\w+)/$', 'projects.p_info_course_edit'),

    (r'^wmlist/$', 'wmail.list'),
    (r'^save_wm/$', 'wmail.save'),
    (r'^add_wm/$','wmail.info'),
    (r'^edit_wm/(?P<wm_id>\w+)/$','wmail.info'),
    (r'^del_wm/(?P<wm_id>\w+)/$','wmail.del_wm'),
    (r'^m_demo/(?P<wm_id>\w+)/$','wmail.mdemo'),

    (r'^allocation/$', 'allocation.show'),
    (r'^allocation/(?P<s_id>\w+)/$','allocation.show'),
    (r'^allocation_do/$', 'allocation.allocation_do'),

    (r'^allocation_set/$', 'allocation.allocation_set'),
    (r'^allocation_set_in/$', 'allocation.allocation_set_in'),
    (r'^clear_caterecord/(?P<pj_id>\w+)/$','allocation.clear_caterecord'),


    (r'^statistics/agent/$', 'statistics.agent'),
    (r'^statistics/sales/$', 'statistics.sales'),

    (r'^csv/import/$', 'dcsv.upload'),
    (r'^csv/export/$', 'dcsv.export'),
    (r'^syslog/$', 'loginfo.syslogs'),

    (r'^changestatus/$', 'users.changestatus'),
    (r'^changelevel/$', 'users.changelevel'),

    (r'^register/$', 'views.crmregister'),
    (r'^program/$', 'views.program'),
    (r'^ajaxaddmail/(?P<cid>\w+)/$', 'wmail.ajaxaddmail'),
    
#grap
    (r'^gsendmail/$', 'grap_mail.sendmail'),
    (r'^gmatchmail/$', 'grap_mail.matchmail'),
    (r'^gmailinfo/$','grap_mail.gmailinfo'),
    (r'^gmaillist/$','grap_mail.gmaillist'),
    (r'^gcreatlist/$','grap_mail.create_maillist'),
    (r'^selectuser/$', 'grap_mail.selectuser'),
    (r'^delgmaillist/$','grap_mail.delgmaillist'),
    (r'^importgmaillist/$','grap_mail.importgmaillist'),
    (r'^gletterlist/$','grap_mail.gletterlist'),
 
#smtp
    (r'^sendmail/$', 'smtp_mail.sendmail'),
    (r'^matchmail/$', 'smtp_mail.matchmail'),
    (r'^systemmail/$', 'smtp_mail.systemadmin'),
    (r'^watch_from_email_details/$', 'smtp_mail.watch_from_email_details'),
    (r'^delsysemail/$', 'smtp_mail.delsysemail'),
    (r'^addsysemail/$', 'smtp_mail.addsysemail'),
    (r'^savesysemail/$', 'smtp_mail.savesysemail'),
    (r'^smaillist/$', 'smtp_mail.smaillist'),
    (r'^optsmaillist/$', 'smtp_mail.optsmaillist'),
    (r'^smtpselectuser/$', 'smtp_mail.selectuser'),
    (r'^smtpcreatlist/$', 'smtp_mail.screatlist'),
    (r'^getsendstate/$', 'smtp_mail.getsendstate'),
    (r'^smtpmailinfo/$', 'smtp_mail.smailinfo'),
    (r'^optstate/$', 'smtp_mail.optstate'),
    (r'^sendphpmail/$', 'smtp_mail.sendphpmail'),
    (r'^uploadfile/$', 'smtp_mail.uploadfile'),

    (r'^maillist/$', 'wmail.maillist'),
    (r'^maillist/(?P<page>\w+)/$', 'wmail.maillist'),
    (r'^onsending/(?P<mid>\w+)/$', 'wmail.onsending'),
    (r'^deletemail/(?P<mid>\w+)/$', 'wmail.deletemail'),
    (r'^saveeditmail/$', 'wmail.saveeditmail'),
    (r'^sendthemail/$', 'wmail.sendthemail'),
    (r'^mailfile/$', 'wmail.mailfile'),
    (r'^delfile/$', 'wmail.delfile'),
    (r'^delatmailfile/(?P<mid>\w+)/$', 'wmail.delatmailfile'),
    (r'^sentmail/$', 'wmail.sentmail'),
    (r'^sentmail/(?P<page>\w+)/$', 'wmail.sentmail'),
    (r'^autosentmail/$', 'wmail.autosentmail'),
    (r'^autosentmail/(?P<page>\w+)/$', 'wmail.autosentmail'),
    (r'^saveaddmail/$', 'wmail.saveaddmail'),
    (r'^dosql/$', 'limit.dosql'),
    (r'^get_new_customer/$','follow_up.get_new_customer'),

    (r'^report_export/$', 'report_account.report_export'),
#sales report
    (r'^sales_recruitment/$','report_sales.recruitment'),
    (r'^sales_sales/$','report_sales.sales'),
    (r'^sales_enrollment/$','report_sales.enrollment'),
    (r'^sales_leads/$','report_sales.leads'),
#management report
    (r'^manage_attend_list/$','report_manage.attend_list'),
    (r'^manage_attend_report/$','report_manage.attend_report'),
    (r'^manage_class_list/$','report_manage.class_list'),
    (r'^manage_class_size/$','report_manage.class_size'),
    (r'^manage_group/$','report_manage.group'),
    (r'^manage_individual/$','report_manage.individual'),
    (r'^manage_student/$','report_manage.student'),
    (r'^manage_tentative/$','report_manage.tentative'),
#account report
    (r'^account_invoice/$','report_account.invoice'),
    (r'^account_receipt/$','report_account.receipt'),
    (r'^account_payment/$','report_account.payment'),
    (r'^account_overdue/$','report_account.overdue'),
)

